<ResourceDictionary x:Class="Topics.Radical.Windows.Controls.Themes.generic"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:controls="clr-namespace:Topics.Radical.Windows.Controls"
	xmlns:t="clr-namespace:Topics.Radical.Windows.Controls.Themes">
	
	<t:GripAlignmentConverter x:Key="GripAlignmentConverter"/>
	<t:GripCursorConverter x:Key="GripCursorConverter"/>
	<t:GripRotationConverter x:Key="GripRotationConverter"/>

	<Style TargetType="{x:Type controls:Resizer}">
		<Setter Property="MinWidth" Value="17"/>
		<Setter Property="MinHeight" Value="17"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:Resizer}">
					<Grid Background="{TemplateBinding Background}">
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True"/>
						<ResizeGrip x:Name="PART_Grip" IsEnabled="{TemplateBinding IsGripEnabled}" HorizontalAlignment="{TemplateBinding ResizeDirection, Converter={StaticResource GripAlignmentConverter}, ConverterParameter={x:Static Orientation.Horizontal}}" VerticalAlignment="{TemplateBinding ResizeDirection, Converter={StaticResource GripAlignmentConverter}, ConverterParameter={x:Static Orientation.Vertical}}" Cursor="{TemplateBinding ResizeDirection, Converter={StaticResource GripCursorConverter}}" Width="17" Height="17" MouseLeftButtonDown="PART_Grip_MouseLeftButtonDown" MouseLeftButtonUp="PART_Grip_MouseLeftButtonUp" MouseMove="PART_Grip_MouseMove" MouseDoubleClick="PART_Grip_MouseDoubleClick" Focusable="False">
							<ResizeGrip.LayoutTransform>
								<RotateTransform Angle="{Binding ResizeDirection, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource GripRotationConverter}}" CenterX="8" CenterY="8"/>
							</ResizeGrip.LayoutTransform>
						</ResizeGrip>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>